First load the data and required packages

library(ggplot2); library(dplyr);library(tidyverse); library(rmcorr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.2 ──
## ✔ tibble  3.1.8     ✔ purrr   0.3.4
## ✔ tidyr   1.1.4     ✔ stringr 1.4.0
## ✔ readr   2.1.2     ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(bestNormalize); library(ggpubr)

df <- read.csv('Study 1 anon.csv')

Figure 1:

How do average levels of politicization and slant (perceptions) associate with trust?

# Get a list of all the group names
all_groups <- c()
for (n in names(df %>% select(starts_with("slant_")))){
  all_groups <- c(all_groups,substring(n,unlist(gregexpr('_', n))[1]+1))
}

trust <- c()
slant <- c()
polit <- c()
for (g in all_groups){
  trust <- c(trust,mean(df[,paste("Trust_",g,sep='')],na.rm=TRUE))
  slant <- c(slant,mean(df[,paste("slant_",g,sep='')],na.rm=TRUE))
  polit <- c(polit,mean(df[,paste("polit_",g,sep='')],na.rm=TRUE))
}
df_means <- data.frame(all_groups,trust,slant,polit)

a <- ggplot(df_means, aes(x=slant, y = trust)) + 
  geom_point() + geom_smooth(method=glm) + 
  ylab('Mean Org. Trust') + xlab('Mean Org. Slant') + 
  theme(axis.text=element_text(size=15), 
        axis.title=element_text(size=15), 
        axis.title.x=element_text(size=15),
        panel.background = element_rect(fill='white'),
        plot.background = element_rect(fill='transparent', color=NA),
        axis.text.x=element_text(size=8, angle=90),
        panel.border = element_rect(colour = "black", fill=NA, size=1))+
  coord_cartesian(xlim = c(20,80), ylim = c(1.5,5.0))

b <- ggplot(df_means, aes(x=polit, y = trust)) + 
  geom_point() + geom_smooth(method=glm) + 
  ylab('Mean Org. Trust') + xlab('Mean Org. Politicization') + 
  theme(axis.text=element_text(size=15), 
        axis.title=element_text(size=15), 
        axis.title.x=element_text(size=15),
        axis.title.y=element_blank(),
        panel.background = element_rect(fill='white'),
        plot.background = element_rect(fill='transparent', color=NA),
        axis.text.x=element_text(size=8, angle=90),
        panel.border = element_rect(colour = "black", fill=NA, size=1))+
  coord_cartesian(xlim = c(1,6), ylim = c(1.5,5.0))

ggarrange(a, b, labels = c("", ""),ncol = 2, nrow = 1, widths=c(1,0.93))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

ggsave("plots/Figure1-Mean-slant-polit-trust.png",width = 8,height = 4,units = "in",dpi = 300)

cor.test(df_means$slant,df_means$trust,method='pearson',conf.level=0.95)
## 
##  Pearson's product-moment correlation
## 
## data:  df_means$slant and df_means$trust
## t = -0.90884, df = 38, p-value = 0.3692
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.4374889  0.1735369
## sample estimates:
##        cor 
## -0.1458572
cor.test(df_means$polit,df_means$trust,method='pearson',conf.level=0.95)
## 
##  Pearson's product-moment correlation
## 
## data:  df_means$polit and df_means$trust
## t = -7.1594, df = 38, p-value = 1.498e-08
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.8650951 -0.5842007
## sample estimates:
##        cor 
## -0.7578022

Figure 2

How do folks on the left and the right differ regarding these relationships toward particular institutions?

plot_politicization <- function(df, polit_col, slant_col,include_y,include_legend) {
  df_reg <- df %>%
    select(!!sym(polit_col), !!sym(slant_col), Ideology) %>%
    drop_na() %>%
    mutate(Party = ifelse(Ideology < 4, "Left", ifelse(Ideology == 4, "Center", "Right"))) %>%
    filter(Party != "Center")
  
  df_reg$Party <- factor(df_reg$Party, levels = c('Left','Center','Right'))
  
  ggplot(df_reg, aes(x=!!sym(slant_col), y = !!sym(polit_col), color=Party,fill=Party)) + 
    geom_point(alpha = 0.5, size =0.5) + 
    geom_jitter(height = 0.5,width = 0.0,alpha = 0.5, size =0.5) +
    geom_smooth(method=glm) + 
    scale_color_manual(values=c("#0000ff",'#ff0803'))+scale_fill_manual(values=c("#0000ff",'#ff0803'))+
    ylab(ifelse(include_y, "Politicization", "")) + 
    xlab(str_to_title(str_replace(slant_col, "_", " "))) + 
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15), 
          axis.title.x=element_text(size=15),
          axis.title.y=element_text(size=15),
          legend.position = ifelse(include_legend,'right',"none"),
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          axis.text.x=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1)) +
    coord_cartesian(xlim = c(0,100), ylim = c(0,6.5))
}

# use the function for each set of columns
a <- plot_politicization(df, "polit_vet", "slant_vet",T,F)
b <- plot_politicization(df, "polit_police", "slant_police",F,F)
c <- plot_politicization(df, "polit_prof", "slant_prof",F,T)

# arrange the plots
ggarrange(a, b, c, labels = c("", "", ""),ncol = 3, nrow = 1, widths=c(0.85,0.78,1))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

ggsave("plots/Figure2-Ideologyxslant-politicization_1.png",width = 10,height = 3.5,units = "in",dpi = 300)

Figure 3

A figure that shows the relationship between politicization and trust for all 40 orgs used in study 1.

plot_congruence <- function(data, group,include_y,xlab_use,include_legend, include_x){
  group_prefix <- paste0("_", group)
  df_reg <- data %>%
    select(ends_with(group_prefix), Ideology) %>%
    drop_na() %>%
    mutate(Slant_2 = get(paste0('slant',group_prefix)) - 50,
           Ideo_2 = Ideology - 4,
           Matched_Bias = Slant_2 * Ideo_2,
           Congruence = case_when(
             is.na(Matched_Bias) ~ NA_character_,
             Matched_Bias < 0 ~ "Incongruent",
             Matched_Bias > 0 ~ "Congruent",
             TRUE ~ 'Neutral'
           )
    ) %>% 
    drop_na()
  df_reg$Congruence <- factor(df_reg$Congruence, levels = c('Incongruent','Neutral','Congruent')) #'Neutral','Congruent'))
  
  a <- ggplot(df_reg, aes(x = get(paste0("polit",group_prefix)), y = get(paste0("Trust",group_prefix)), color = Congruence)) + 
    geom_smooth(method = glm,se=F) + 
    scale_color_manual(values = c('#FF5733','#d4af37',"#007200")) + 
    ylab(ifelse(include_y, "Trust", ""))  + ggtitle(xlab_use) + xlab(ifelse(include_x, "Politicization", "")) + 
    ylim(0.5, 6.2) + xlim(0.5,6.2)+ labs(color = NULL)+
    theme(
      axis.text = element_text(size = 20), # 25
      plot.margin = unit(c(-0.04,0.01,-0.11,0.01), 'lines'),
      plot.title = element_text(size = 22), #27
      axis.title.x = element_text(size = 20),
      axis.title.y = element_text(size = 20),
      legend.key=element_rect(fill="white"),
      legend.text=element_text(size=20),
      legend.position = ifelse(include_legend,'right',"none"),
      panel.background = element_rect(fill = 'white'),
      plot.background = element_rect(fill = 'white'),
      axis.text.x = element_text(size = ifelse(include_x, 12, 0)),
      axis.text.y = element_text(size = ifelse(include_y, 12, 0)),
      panel.border = element_rect(colour = "black", fill = NA, size = 1)
    )
  
  return(a)
}
d <- list()
labels_here <- c()

# Order by politicization
all_groups <- c("Cong","SC","UN","journ","crim","church","FB","judge","holly","PETA","prof","CIA",
                          "poll","police","think","pharm","WHO","K12","law","econ","bank","psych","localbiz",
                          "sci","ASPCA","lib","NFL","doc","realestate","phys","rang","mech","fire","chefs","USPS",
                          "MLB","vet","dent","tailor","toll")
all_group_labels <- c("Congress","Supreme Court","United Nations","Journalists","Criminal Justice","Catholic Church",
                     "Facebook","State Judges","Hollywood","PETA","Professors","CIA","Pollsters","Police",
                     "Think Tanks","Pharmaceutical","WHO","K12 Teachers","Lawyers","Economists","Banks",
                     "Psychologists","Local Business","Scientists","ASPCA","Librarians","NFL","Doctors",
                     "Real Estate","Physicists","Park Rangers","Mechanics","Firefighters","Chefs","USPS",
                     "MLB","Veterinarians","Dentists","Tailors","Toll Workers")

# Order by slant
ag <- c("church","police","SC","bank","mech","fire","localbiz","crim","judge","pharm","MLB","realestate",
                "dent","rang","econ","CIA","law","doc","Cong","toll","tailor","USPS","NFL","think","vet","poll",
                "chefs","phys","UN","FB","sci","K12","lib","psych","ASPCA","journ","WHO","prof","PETA","holly")
all_groups <- rev(ag)
agl <- c("Catholic Church","Police","Supreme Court","Banks","Mechanics","Firefighters","Local Business",
                      "Criminal Justice","State Judges","Pharmaceutical","MLB","Real Estate","Dentists","Park Rangers",
                      "Economists","CIA","Lawyers","Doctors","Congress","Toll Workers","Tailors","USPS","NFL","Think Tanks",
                      "Veterinarians","Pollsters","Chefs","Physicists","United Nations","Facebook","Scientists","K12 Teachers",
                      "Librarians","Psychologists","ASPCA","Journalists","WHO","Professors","PETA","Hollywood")
all_group_labels <- rev(agl)

for (org in 1:length(all_groups)){
  put_legend = F
  put_x = F
  put_y = F
  if (org %% 8 == 0) {#5 for 8 x 5
    put_legend = T
  }
  if (org / 8 >= 4.01) { # 4.5 8 x 5 
    put_x = T
  }
  if (org %% 8 == 1){ # 5 for row
    put_y = T
  }
  plot <- plot_congruence(df, all_groups[org],put_y,all_group_labels[org],put_legend,put_x)
  d[[org]] <- plot
  labels_here <- c(labels_here,"")
}

# Portrait version
#ggarrange(plotlist=d, labels = labels_here,ncol = 5, nrow = 8, widths=c(0.8,0.78,0.78,0.78,1.38))
#ggsave("plots/ALL_orgs_2.png",width = 17,height = 22,units = "in",dpi = 300)

ggarrange(plotlist=d, labels = labels_here,ncol = 8, nrow = 5, widths=c(0.8,0.78,0.78,0.78,0.78,0.78,0.78,1.4))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 10 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 12 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 16 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 34 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 19 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 67 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 22 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 48 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 8 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 50 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 23 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 44 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 26 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 23 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 22 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 36 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 8 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 13 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 5 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 42 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 32 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 11 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 5 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 10 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 63 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 6 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 13 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 14 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 17 rows containing non-finite values (stat_smooth).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 14 rows containing non-finite values (stat_smooth).

ggsave("plots/Figure3-All-orgs.png",width = 24,height = 15,units = "in",dpi = 300)

Figure 3 ALT

Next we want to look at ideological congruence for several organizations:

plot_congruence <- function(data, group,include_y,xlab_use,include_legend){
  group_prefix <- paste0("_", group)
  df_reg <- data %>%
    select(ends_with(group_prefix), Ideology) %>%
    drop_na() %>%
    mutate(Slant_2 = get(paste0('slant',group_prefix)) - 50,
           Ideo_2 = Ideology - 4,
           Matched_Bias = Slant_2 * Ideo_2,
           Congruence = case_when(
             is.na(Matched_Bias) ~ NA_character_,
             Matched_Bias < 0 ~ "Incongruent",
             Matched_Bias > 0 ~ "Congruent",
             TRUE ~ 'Neutral'
           )
    ) %>% 
    filter(Congruence != 'Neutral') %>% # Remove if you want Neutral
    drop_na()
  df_reg$Congruence <- factor(df_reg$Congruence, levels = c('Incongruent','Congruent')) #'Neutral','Congruent'))
  
  a <- ggplot(df_reg, aes(x = get(paste0("polit",group_prefix)), y = get(paste0("Trust",group_prefix)), color = Congruence, fill=Congruence)) + 
    geom_point(alpha = 0.75, size = 0.5) + 
    geom_jitter(height = 0.5, width = 0.5, alpha = 0.5, size = 0.75) + 
    geom_smooth(method = glm) + 
    scale_color_manual(values = c('#FF5733',"#007200")) + 
    scale_fill_manual(values = c('#FF5733',"#007200")) +
    #scale_color_manual(values = c('#FF5733','#d4af37',"#007200")) + # If you want neutral
    #scale_fill_manual(values = c('#FF5733','#d4af37',"#007200")) +
    ylab(ifelse(include_y, "Trust", ""))  + 
    xlab(paste0('Politicization (', xlab_use, ')')) + 
    theme(
      axis.text = element_text(size = 15), 
      axis.title = element_text(size = 15), 
      axis.title.x = element_text(size = 15),
      legend.position = ifelse(include_legend,'right',"none"),
      panel.background = element_rect(fill = 'white'),
      plot.background = element_rect(fill = 'transparent', color = NA),
      axis.text.x = element_text(size = 8, angle = 90),
      panel.border = element_rect(colour = "black", fill = NA, size = 1)
    )
  
  return(a)
}

a1 = plot_congruence(df, "vet",T,"Vets",F)
a2 = plot_congruence(df, "police",F,"Police",T) # Depending on order of column either 2 or 3 ends with 'T'
a3 = plot_congruence(df, "prof",F,"Professors",F)
b1 = plot_congruence(df, "toll",T,"Toll Booth",F)
b2 = plot_congruence(df, "SC",F,"Supreme Court",T)
b3 = plot_congruence(df, "WHO",F,"WHO",F)
c1 = plot_congruence(df, "chefs",T,"Chefs",F)
c2 = plot_congruence(df, "church",F,"Church",T)
c3 = plot_congruence(df, "PETA",F,"PETA",F)

# Order for center, right, left (columns)
#ggarrange(a1, a2, a3, b1, b2, b3, c1, c2, c3, labels = c("", "", "","", "", "","", "", ""),ncol = 3, nrow = 3, widths=c(0.85,0.78,1.15))
#ggsave("plots/Figure3-Congrencextrust-politicization.png",width = 10,height = 10.5,units = "in",dpi = 300)

# Order for left, center, right (columns)
ggarrange(a3, a1, a2, b3, b1, b2, c3, c1, c2, labels = c("", "", "","", "", "","", "", ""),ncol = 3, nrow = 3, widths=c(0.85,0.78,1.15))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

ggsave("plots/Figure3ALT-Congrencextrust-politicizationb.png",width = 10,height = 10.5,units = "in",dpi = 300)

Figure 3b (Appendix)

Another figure with significant interactions for 3 other groups

a1 = plot_congruence(df, "econ",T,"Economists",F)
b1 = plot_congruence(df, "holly",F,"Hollywood",F)
c1 = plot_congruence(df, "think",F,"Think Tanks",T)

ggarrange(a1, b1, c1, labels = c("", "", ""),ncol = 3, nrow = 1, widths=c(0.85,0.78,1.15))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

ggsave("plots/Figure3Altb-Congrencextrust-politicization.png",width = 10,height = 3.5,units = "in",dpi = 300)

Figure 4

Here, we need to load the data from study 2:

library(readxl)
df_2 <- read_excel('Study 2 anon.xlsx')

For this next figure, I want to look at trust for the congruent, incongruent, and neutral groups from Study2

plot_congruence_2 <- function(data, group,include_y,xlab_use,include_legend,trust){
  df_reg <- data %>%
    select(ends_with(group), Ideology) %>%
    drop_na() %>%
    mutate(
      Slant_2 = get(paste0('Slant',group)) - 4,
      Ideo_2 = Ideology - 4,
      Matched_Bias = Slant_2 * Ideo_2,
      Congruence = case_when(
        is.na(Matched_Bias) ~ NA_character_,
        Matched_Bias < 0 ~ "Incongruent",
        Matched_Bias > 0 ~ "Congruent",
        TRUE ~ "Neutral"
      )
    ) %>%
    drop_na() %>%
    mutate(Congruence = factor(Congruence, levels = c("Incongruent","Neutral", "Congruent")))
  
    if (group == "Fire" | group == 'Doc'){
      print(nrow(df_reg %>% filter(Congruence == 'Incongruent')))
      print(nrow(df_reg %>% filter(Congruence == 'Neutral')))
      print(nrow(df_reg %>% filter(Congruence == 'Congruent')))
      #df_reg <- df_reg %>% filter(Congruence == 'Neutral') 
    }
  
  a <- ggplot(df_reg, aes(x=get(paste0("Polit",group)), y = get(paste0(ifelse(trust, "Trust", "Support"),group)), color = Congruence)) + 
    geom_point(alpha = 0.5, size =0.5) + geom_jitter(height = 0.5,width = 0.5,alpha = 0.5, size =0.5) + geom_smooth(method=glm,aes(fill=Congruence)) + 
    ylim(0.5, 6.2) +
    scale_color_manual(values=c('Incongruent' = '#FF5733','Neutral' = '#d4af37','Congruent' = "#007200"),drop=FALSE)+
    scale_fill_manual(values=c('Incongruent' = '#FF5733','Neutral' = '#d4af37','Congruent' = "#007200"),drop=FALSE)+
    ylab(ifelse(include_y, ifelse(trust, "Trust", "Support"), ""))  + 
    xlab(paste0('Politicization (', xlab_use, ')')) +
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15), 
          axis.title.x=element_text(size=15),
          legend.position = ifelse(include_legend,'right',"none"),
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          axis.text.x=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1))
  return(a)
}

a1 = plot_congruence_2(df_2, "Prof",T,"Professors",F,T)
a2 = plot_congruence_2(df_2, "Fire",F,"Fire",F,T)
## [1] 49
## [1] 504
## [1] 47
a3 = plot_congruence_2(df_2, "Police",F,"Police",T,T)
b1 = plot_congruence_2(df_2, "Who",T,"WHO",F,T)
b2 = plot_congruence_2(df_2, "Doc",F,"Doctors",F,T)
## [1] 61
## [1] 479
## [1] 50
b3 = plot_congruence_2(df_2, "Judge",F,"Judges",T,T)
ggarrange(a1, a2, a3, b1, b2, b3, labels = c("", "", "","", "", "","", "", ""),ncol = 3, nrow = 2, widths=c(0.85,0.78,1.15))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 8 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 44 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 7 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 15 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 8 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing missing values (geom_point).

ggsave("plots/Figure4-Study-2_Congrencextrust-politicization_2.png",width = 10,height = 7,units = "in",dpi = 300)

Figure 5

We will create a similar figure to Fig. 4, but with support instead of trust

a1 = plot_congruence_2(df_2, "Prof",T,"Professors",F,F)
a2 = plot_congruence_2(df_2, "Fire",F,"Fire",F,F)
## [1] 49
## [1] 504
## [1] 47
a3 = plot_congruence_2(df_2, "Police",F,"Police",T,F)
b1 = plot_congruence_2(df_2, "Who",T,"WHO",F,F)
b2 = plot_congruence_2(df_2, "Doc",F,"Doctors",F,F)
## [1] 61
## [1] 479
## [1] 50
b3 = plot_congruence_2(df_2, "Judge",F,"Judges",T,F)
ggarrange(a1, a2, a3, b1, b2, b3, labels = c("", "", "","", "", "","", "", ""),ncol = 3, nrow = 2, widths=c(0.85,0.78,1.15))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 14 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 6 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing missing values (geom_point).

ggsave("plots/Figure5-CongrencexSupport-politicization_2.png",width = 10,height = 7,units = "in",dpi = 300)

Figure Appendix

We now want to look at our results from study 3. First, let’s load the data

df_3 = read.csv('Study 3 anon.csv')

#df_3$TrustProf<- df_3$Trust_Prof + df_3$Trust_Prof.0 + df_3$Trust_Prof.1
#df_3$PolitProf <- df_3$Polit_Prof + df_3$Polit_Prof.0 + df_3$Polit_Prof.1
#df_3$SlantProf <- df_3$Slant_Prof + df_3$Slant_Prof.0 + df_3$Slant_Prof.1

#df_3$TrustPolice <- df_3$Trust_police + df_3$Trust_Police.0 + df_3$Trust_Police.1
#df_3$PolitPolice <- df_3$Polit_Police + df_3$Polit_Police.0 + df_3$Polit_Police.1
#df_3$SlantPolice <- df_3$Slant_Police + df_3$Slant_Police.0 + df_3$Slant_Police.1

Next, we want to look at the relationship betweeen trust and politicization based on folks’ ideology

plot_parties <- function(data, group,include_y,xlab_use,include_legend,trust){
  data$party <- ifelse(is.na(data$Ideology), NA,
                       ifelse(data$Ideology < 4, "Left-leaning",
                              ifelse(data$Ideology == 4, "Central", "Right-leaning")))
  data$party <- factor(data$party, levels = c('Left-leaning','Central','Right-leaning'))
  
  a <- ggplot(data, aes(x=get(paste0('Polit',group)), y = get(paste0(ifelse(trust, "Trust", "Support"),group)), color=party)) + 
    geom_point(alpha = 0.5, size =0.5) + geom_jitter(height = 0.5,width = 0.5,alpha = 0.5, size =0.5) + geom_smooth(method=glm,aes(fill=party)) + 
    scale_color_manual(values=c('blue','gray',"red"))+ scale_fill_manual(values=c('blue','gray',"red"))+
    xlab(paste0('Politicization (',xlab_use,')')) +  
    ylab(ifelse(include_y, ifelse(trust, "Trust", "Support"), ""))  + 
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15),
          axis.title.y = element_text(size=15),
          axis.title.x=element_text(size=15),
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          legend.position = ifelse(include_legend,'right',"none"),
          axis.text.x=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1))
  return(a)
}

df_reg <- df_3 %>% select(Ideology,ACProfPass,TrustProf,PolitProf) %>% drop_na() %>% filter(ACProfPass == 1)
a1 <- plot_parties(df_reg,'Prof',T,'Professors',F,T)
df_reg <- df_3 %>% select(Ideology,ACPolicePass,TrustPolice,PolitPolice) %>% drop_na() %>% filter(ACPolicePass == 1)
b1 <- plot_parties(df_reg,'Police',F,'Police',T,T)


ggarrange(a1, b1, labels = c("", ""),ncol = 2, nrow = 1, widths=c(0.85,1.15))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

ggsave("plots/FigureAppendix-Partyxpoliticization-trust.png",width = 8,height = 3.5,units = "in",dpi = 300)

Figure 6 and 7

plot_congruence_2 <- function(data, group,include_y,xlab_use,include_legend,trust){
  df_reg <- data %>%
    select(ends_with(group), Ideology) %>%
    drop_na() %>%
    mutate(
      Slant_2 = get(paste0('Slant',group)) - 4,
      Ideo_2 = Ideology - 4,
      Matched_Bias = Slant_2 * Ideo_2,
      Congruence = case_when(
        is.na(Matched_Bias) ~ NA_character_,
        Matched_Bias < 0 ~ "Incongruent",
        Matched_Bias > 0 ~ "Congruent",
        TRUE ~ "Neutral"
      )
    ) %>%
    drop_na() %>%
    mutate(Congruence = factor(Congruence, levels = c("Incongruent","Neutral", "Congruent")))
  
    if (group == "Fire" | group == 'Doc'){
      print(nrow(df_reg %>% filter(Congruence == 'Incongruent')))
      print(nrow(df_reg %>% filter(Congruence == 'Neutral')))
      print(nrow(df_reg %>% filter(Congruence == 'Congruent')))
      df_reg <- df_reg %>% filter(Congruence == 'Neutral') 
    }
  
  a <- ggplot(df_reg, aes(x=get(paste0("Polit",group)), y = get(paste0(ifelse(trust, "Trust", "Support"),group)), color = Congruence)) + 
    geom_point(alpha = 0.5, size =0.5) + geom_jitter(height = 0.5,width = 0.5,alpha = 0.5, size =0.5) + geom_smooth(method=glm,aes(fill=Congruence)) + 
    ylim(0.5, 6.2) +
    scale_color_manual(values=c('Incongruent' = '#FF5733','Neutral' = '#d4af37','Congruent' = "#007200"),drop=FALSE)+
    scale_fill_manual(values=c('Incongruent' = '#FF5733','Neutral' = '#d4af37','Congruent' = "#007200"),drop=FALSE)+
    ylab(ifelse(include_y, ifelse(trust, "Trust", "Support"), ""))  + 
    xlab(paste0('Politicization (', xlab_use, ')')) +
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15), 
          axis.title.x=element_text(size=15),
          legend.position = ifelse(include_legend,'right',"none"),
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          axis.text.x=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1))
  return(a)
}



df_reg <- df_3 %>% select(Ideology,ACProfPass,TrustProf,PolitProf,SlantProf) %>% drop_na() %>% filter(ACProfPass == 1)
a1 <- plot_congruence_2(df_reg,'Prof',T,'Professors',F,T)
df_reg <- df_3 %>% select(Ideology,ACPolicePass,TrustPolice,PolitPolice,SlantPolice) %>% drop_na() %>% filter(ACPolicePass == 1)
b1 <- plot_congruence_2(df_reg,'Police',F,'Police',T,T)


ggarrange(a1, b1, labels = c("", ""),ncol = 2, nrow = 1, widths=c(0.85,1.15))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 14 rows containing missing values (geom_point).

ggsave("plots/Figure6-Congruencexpoliticization-trust.png",width = 8,height = 3.5,units = "in",dpi = 300)



# Create Figure 8 by looking at support
df_reg <- df_3 %>% select(Ideology,ACProfPass,SupportProf,PolitProf,SlantProf) %>% drop_na() %>% filter(ACProfPass == 1)
a1 <- plot_congruence_2(df_reg,'Prof',T,'Professors',F,F)
df_reg <- df_3 %>% select(Ideology,ACPolicePass,SupportPolice,PolitPolice,SlantPolice) %>% drop_na() %>% filter(ACPolicePass == 1)
b1 <- plot_congruence_2(df_reg,'Police',F,'Police',T,F)


ggarrange(a1, b1, labels = c("", ""),ncol = 2, nrow = 1, widths=c(0.85,1.15))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 2 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing missing values (geom_point).

ggsave("plots/Figure7-Congruencexpoliticization-support.png",width = 8,height = 3.5,units = "in",dpi = 300)



df_reg <- df_3 %>% select(Ideology,PolitProf,SlantProf,TrustProf,SupportProf, ACProfPass) %>% drop_na() %>% filter(ACProfPass == 1)
df_reg <- df_reg %>%
    select(ends_with('Prof'), Ideology) %>%
    drop_na() %>%
    mutate(
      Slant_2 = get(paste0('Slant','Prof')) - 4,
      Ideo_2 = Ideology - 4,
      Matched_Bias = Slant_2 * Ideo_2,
      Congruence = case_when(
        is.na(Matched_Bias) ~ NA_character_,
        Matched_Bias < 0 ~ "Incongruent",
        Matched_Bias > 0 ~ "Congruent",
        TRUE ~ "Neutral"
      )
    ) %>%
    drop_na() %>%
    mutate(Congruence = factor(Congruence, levels = c("Incongruent","Neutral", "Congruent")))

# Get correlations
df_c <- df_reg %>% filter(Congruence == "Congruent")
cor.test(df_c$PolitProf,df_c$TrustProf)
## 
##  Pearson's product-moment correlation
## 
## data:  df_c$PolitProf and df_c$TrustProf
## t = -1.6628, df = 332, p-value = 0.0973
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.19627858  0.01659814
## sample estimates:
##         cor 
## -0.09087827
cor.test(df_c$PolitProf,df_c$SupportProf)
## 
##  Pearson's product-moment correlation
## 
## data:  df_c$PolitProf and df_c$SupportProf
## t = -2.0325, df = 332, p-value = 0.0429
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.215609647 -0.003588358
## sample estimates:
##        cor 
## -0.1108602
df_reg <- df_3 %>% select(Ideology,ACPolicePass,SupportPolice,TrustPolice,PolitPolice,SlantPolice) %>% filter(ACPolicePass == 1)
df_reg <- df_reg %>%
    select(ends_with('Police'), Ideology) %>%
    drop_na() %>%
    mutate(
      Slant_2 = get(paste0('Slant','Police')) - 4,
      Ideo_2 = Ideology - 4,
      Matched_Bias = Slant_2 * Ideo_2,
      Congruence = case_when(
        is.na(Matched_Bias) ~ NA_character_,
        Matched_Bias < 0 ~ "Incongruent",
        Matched_Bias > 0 ~ "Congruent",
        TRUE ~ "Neutral"
      )
    ) %>%
    drop_na() %>%
    mutate(Congruence = factor(Congruence, levels = c("Incongruent","Neutral", "Congruent")))

df_c <- df_reg %>% filter(Congruence == "Congruent")
cor.test(df_c$PolitPolice,df_c$TrustPolice)
## 
##  Pearson's product-moment correlation
## 
## data:  df_c$PolitPolice and df_c$TrustPolice
## t = -3.6853, df = 294, p-value = 0.0002719
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.31655482 -0.09848864
## sample estimates:
##        cor 
## -0.2101337
cor.test(df_c$PolitPolice,df_c$SupportPolice)
## 
##  Pearson's product-moment correlation
## 
## data:  df_c$PolitPolice and df_c$SupportPolice
## t = -3.0925, df = 294, p-value = 0.002175
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.28571666 -0.06480035
## sample estimates:
##        cor 
## -0.1774936

Plot 8

Does the negative relationship between politicization and trust hold for individuals at the extreme ends of the political spectrum?

plot_extremes <- function(data, group, xlab_use, trust, include_title) {
  df_reg <- data %>%
    select(ends_with(group), Ideology) %>%
    drop_na() %>%
    mutate(
      Slant_2 = get(paste0('Slant',group)) - 4,
      Ideo_2 = Ideology - 4,
      Matched_Bias = Slant_2 * Ideo_2,
      Congruence = case_when(
        is.na(Matched_Bias) ~ NA_character_,
        Matched_Bias < 0 ~ "Incongruent",
        Matched_Bias > 0 ~ "Congruent",
        TRUE ~ "Neutral"
      )
    ) %>%
    drop_na() %>%
    mutate(Congruence = factor(Congruence, levels = c("Incongruent","Neutral", "Congruent")))
  
  # Because so few people are congruent and of atypical ideology (e.g., left-leaning and congruent with police),
  # we limit our analysis to only those who follow the typical pattern
  df_c <- df_reg  %>% filter(Congruence == "Congruent")
  df_i <- df_reg  %>% filter(Congruence == "Incongruent")
  if (group == 'Police') {
    df_c <- df_c %>% filter(Ideology > 4) 
    df_i <- df_i %>% filter(Ideology < 4)
  } else {
    df_c <- df_c %>% filter(Ideology < 4) 
    df_i <- df_i %>% filter(Ideology > 4)
  }

  df_c$Ideology <- as.character(df_c$Ideology)
  df_i$Ideology <- as.character(df_i$Ideology)
  
  a <- ggplot(df_c, aes(x=get(paste0("Polit",group)), y = get(paste0(ifelse(trust, "Trust", "Support"),group)), color = Ideology)) + 
    geom_point(alpha = 0.5, size =0.5) + geom_jitter(height = 0.5,width = 0.5,alpha = 0.5, size =0.5) + geom_smooth(method=glm,aes(fill=Ideology)) + 
    ylim(0.5, 6.2) +
    scale_color_manual(values=c('1' = '#1E2F97','2' = '#1AA7EC','3' = "#4ADEDE", "5"="#FF8A8A","6"="#FF0000","7"="#A30000"),drop=FALSE)+ ggtitle(ifelse(include_title,"Congruent","")) + 
    scale_fill_manual(values=c('1' = '#1E2F97','2' = '#1AA7EC','3' = "#4ADEDE", "5"="#FF8A8A","6"="#FF0000","7"="#A30000"),drop=FALSE)+
    ylab(ifelse(trust, "Trust", "Support"))  + 
    xlab(paste0('Politicization (', xlab_use, ')')) +
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15), 
          axis.title.x=element_text(size=15),
          plot.title = element_text(size=17),
          legend.position = "none",
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          axis.text.x=element_text(size=8, angle=90),
          axis.text.y=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1))
  
  b <- ggplot(df_i, aes(x=get(paste0("Polit",group)), y = get(paste0(ifelse(trust, "Trust", "Support"),group)), color = Ideology)) + 
    geom_point(alpha = 0.5, size =0.5) + geom_jitter(height = 0.5,width = 0.5,alpha = 0.5, size =0.5) + geom_smooth(method=glm,aes(fill=Ideology)) + 
    ylim(0.5, 6.2) +
    scale_color_manual(values=c('1' = '#1E2F97','2' = '#1AA7EC','3' = "#4ADEDE", "5"="#FF8A8A","6"="#FF0000","7"="#A30000"),drop=FALSE)+ ggtitle(ifelse(include_title,"Incongruent","")) + 
    scale_fill_manual(values=c('1' = '#1E2F97','2' = '#1AA7EC','3' = "#4ADEDE", "5"="#FF8A8A","6"="#FF0000","7"="#A30000"),drop=FALSE)+
    ylab("")  + 
    xlab(paste0('Politicization (', xlab_use, ')')) +
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15), 
          axis.title.x=element_text(size=15),
          plot.title = element_text(size=17),
          legend.position = 'right',
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          axis.text.x=element_text(size=8, angle=90),
          axis.text.y=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1))
  return(list(a, b))
}


df_reg <- df_3 %>% select(Ideology,ACPolicePass,TrustPolice,PolitPolice,SlantPolice) %>% drop_na() %>% filter(ACPolicePass == 1)
police_plots <- plot_extremes(df_reg, 'Police', 'Police',T, T)

df_reg <- df_3 %>% select(Ideology,ACProfPass,TrustProf,PolitProf,SlantProf) %>% drop_na() %>% filter(ACProfPass == 1)
profs_plots <- plot_extremes(df_reg, 'Prof', 'Professors',T, F)

ggarrange(police_plots[[1]], police_plots[[2]], profs_plots[[1]], profs_plots[[2]], labels = c("", "","",""),ncol = 2, nrow = 2, widths=c(0.85,1.15))
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 9 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 3 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 1 rows containing missing values (geom_point).

ggsave("plots/Figure8-PoliticizationxTrust_Extreme_Ideology.png",width = 8,height = 5,units = "in",dpi = 300)

Study 4

Load the data

df = read_csv('Study 4 Anon.csv')
## Rows: 612 Columns: 74
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr  (3): Gender__5_TEXT, Open_, Condition
## dbl (70): DummyID, Rang_ControlT_First_Click, Rang_ControlT_Last_Click, Rang...
## lgl  (1): Gender__4
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
df <- df %>%
    mutate(
      Ideo_2 = Ideology - 4,
      Condition = case_when(
        is.na(RangCond) ~ NA_character_,
        RangCond < 0 ~ "Biden",
        RangCond > 0 ~ "Trump",
        TRUE ~ "Control"
      )
    ) %>%
    mutate(Condition = factor(Condition, levels = c("Biden","Control", "Trump")))

Figure 9

Trust/Support for different organizations based on condition and political ideology

plot_conditions <- function(data,outcome,include_y,ylab_use, include_x,xlab_use,include_legend){

  a <- ggplot(data, aes(x=Ideology, y = get(outcome), color = Condition)) + 
    geom_point(alpha = 0.5, size =0.5) + geom_jitter(height = 0.5,width = 0.5,alpha = 0.5, size =0.5) + geom_smooth(method=glm,aes(fill=Condition)) + 
    ylim(0.5, 6.2) +
    scale_color_manual(values=c('Biden' = '#0603C8','Control' = '#228B22','Trump' = "#990F02"),drop=FALSE)+
    scale_fill_manual(values=c('Biden' = '#0603C8','Control' = '#228B22','Trump' = "#990F02"),drop=FALSE)+
    ylab(ifelse(include_y, ylab_use, ""))  + 
    xlab(ifelse(include_x,  xlab_use, "")) +
    theme(axis.text=element_text(size=15), 
          axis.title=element_text(size=15), 
          axis.title.x=element_text(size=15),
          legend.position = ifelse(include_legend,'right',"none"),
          panel.background = element_rect(fill='white'),
          plot.background = element_rect(fill='transparent', color=NA),
          axis.text.x=element_text(size=8, angle=90),
          panel.border = element_rect(colour = "black", fill=NA, size=1))
  return(a)
}

a1 <- plot_conditions(df,'TrustRang',T,'Trust Get Outdoors',F,'',F)
a2 <- plot_conditions(df,'SupportRang',T,"Support Get Outdoors",F,"",T)
b1 <- plot_conditions(df,'TrustAllRang',T,'Trust All Rangers',T,"Ideology",F)
b2 <- plot_conditions(df,'SupportAllRang',T,'Support All Rangers',T,"Ideology",T)

ggarrange(a1, a2, b1, b2, labels = c("", "","",""),ncol = 2, nrow = 2, widths=c(0.85,1.15)) + bgcolor("White")
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## Warning: Removed 4 rows containing missing values (geom_point).
## Warning: Removed 17 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## Warning: Removed 4 rows containing missing values (geom_point).
## Warning: Removed 7 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## Warning: Removed 4 rows containing missing values (geom_point).
## Warning: Removed 17 rows containing missing values (geom_point).
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 4 rows containing non-finite values (stat_smooth).
## Warning: Removed 4 rows containing missing values (geom_point).
## Warning: Removed 5 rows containing missing values (geom_point).

ggsave("plots/Figure9-Trust-Condition-Ideology.png",width = 10,height = 6,units = "in",dpi = 300)

Figure 10

Plot the donation about by condition and ideology

plot_votes <- function(df, org) {
  data <- df
  data <- data %>% mutate(Donate = as.numeric(Donate),
              Vote = case_when(Vote == 1 ~ "Trump Voters", 
                               Vote == 2 ~ "Biden Voters",
                               Vote == 3 ~ 'Other/Neither'),
              Donate = case_when(Donate == 1 ~ "Firefighters", 
                               Donate == 2 ~ "Get Outdoors",
                               Donate == 3 ~ 'Dentists')) %>%
    mutate(Vote = factor(Vote, levels = c("Trump Voters","Biden Voters", "Other/Neither")))
  data <- data %>% select(Condition, Vote, Donate) %>% drop_na()
  data <- data %>% group_by(Vote, Condition, Donate) %>% summarise(Count_Donate = length(Donate))
  data <- data %>% group_by(Vote, Condition) %>%
    mutate(prop = Count_Donate / sum(Count_Donate)) %>% filter(Donate == org)
  
  
  a <- ggplot(data, aes(fill= Condition, x = Vote, y = prop))+
    geom_bar(position="dodge", stat="identity")+ 
    scale_color_manual(values=c('Biden' = '#0603C8','Control' = '#228B22','Trump' = "#990F02"),drop=FALSE)+
    scale_fill_manual(values=c('Biden' = '#0603C8','Control' = '#228B22','Trump' = "#990F02"),drop=FALSE)+
    ylab('Proportion of Vote') + xlab("") + ggtitle(paste("Votes to:",org)) + 
    theme_bw()
  return(a)
}


plot_votes(df, "Get Outdoors")
## `summarise()` has grouped output by 'Vote', 'Condition'. You can override using
## the `.groups` argument.

ggsave("plots/Figure10-Donations.png",width = 5,height = 3,units = "in",dpi = 300)

Figure appendix B

Finally, we’ll make one more figure that is much like the previous, but with support

df_reg <- df_3 %>% select(Ideology,ACProfPass,SupportProf,PolitProf,SlantProf) %>% drop_na() %>% filter(ACProfPass == 1)
a1 <- plot_parties(df_reg,'Prof',T,'Professors',F,F)
df_reg <- df_3 %>% select(Ideology,ACPolicePass,SupportPolice,PolitPolice,SlantPolice) %>% drop_na() %>% filter(ACPolicePass == 1)
b1 <- plot_parties(df_reg,'Police',F,'Police',T,F)


ggarrange(a1, b1, labels = c("", ""),ncol = 2, nrow = 1, widths=c(0.85,1.15))
## `geom_smooth()` using formula 'y ~ x'
## `geom_smooth()` using formula 'y ~ x'

ggsave("plots/FigureAppendix2-Partyxpoliticization-support.png",width = 8,height = 3.5,units = "in",dpi = 300)